3.440 \(\int \cos ^3(c+d x) (a+b \tan ^2(c+d x))^2 \, dx\)

Optimal. Leaf size=56 \[ \frac {\left (a^2-b^2\right ) \sin (c+d x)}{d}-\frac {(a-b)^2 \sin ^3(c+d x)}{3 d}+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

b^2*arctanh(sin(d*x+c))/d+(a^2-b^2)*sin(d*x+c)/d-1/3*(a-b)^2*sin(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3676, 390, 206} \[ \frac {\left (a^2-b^2\right ) \sin (c+d x)}{d}-\frac {(a-b)^2 \sin ^3(c+d x)}{3 d}+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^3*(a + b*Tan[c + d*x]^2)^2,x]

[Out]

(b^2*ArcTanh[Sin[c + d*x]])/d + ((a^2 - b^2)*Sin[c + d*x])/d - ((a - b)^2*Sin[c + d*x]^3)/(3*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \cos ^3(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a-(a-b) x^2\right )^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {\operatorname {Subst}\left (\int \left (a^2-b^2-(a-b)^2 x^2+\frac {b^2}{1-x^2}\right ) \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {\left (a^2-b^2\right ) \sin (c+d x)}{d}-\frac {(a-b)^2 \sin ^3(c+d x)}{3 d}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {\left (a^2-b^2\right ) \sin (c+d x)}{d}-\frac {(a-b)^2 \sin ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.43, size = 71, normalized size = 1.27 \[ \frac {\sin (c+d x) \left (\frac {3 b^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right )}{\sqrt {\sin ^2(c+d x)}}-(a-b) \left ((a-b) \sin ^2(c+d x)-3 (a+b)\right )\right )}{3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^3*(a + b*Tan[c + d*x]^2)^2,x]

[Out]

(Sin[c + d*x]*((3*b^2*ArcTanh[Sqrt[Sin[c + d*x]^2]])/Sqrt[Sin[c + d*x]^2] - (a - b)*(-3*(a + b) + (a - b)*Sin[
c + d*x]^2)))/(3*d)

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 79, normalized size = 1.41 \[ \frac {3 \, b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + 2 \, a b - 4 \, b^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

1/6*(3*b^2*log(sin(d*x + c) + 1) - 3*b^2*log(-sin(d*x + c) + 1) + 2*((a^2 - 2*a*b + b^2)*cos(d*x + c)^2 + 2*a^
2 + 2*a*b - 4*b^2)*sin(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 3.02, size = 96, normalized size = 1.71 \[ -\frac {2 \, a^{2} \sin \left (d x + c\right )^{3} - 4 \, a b \sin \left (d x + c\right )^{3} + 2 \, b^{2} \sin \left (d x + c\right )^{3} - 3 \, b^{2} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) + 3 \, b^{2} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - 6 \, a^{2} \sin \left (d x + c\right ) + 6 \, b^{2} \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x, algorithm="giac")

[Out]

-1/6*(2*a^2*sin(d*x + c)^3 - 4*a*b*sin(d*x + c)^3 + 2*b^2*sin(d*x + c)^3 - 3*b^2*log(abs(sin(d*x + c) + 1)) +
3*b^2*log(abs(sin(d*x + c) - 1)) - 6*a^2*sin(d*x + c) + 6*b^2*sin(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 0.62, size = 104, normalized size = 1.86 \[ -\frac {b^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{3 d}-\frac {b^{2} \sin \left (d x +c \right )}{d}+\frac {b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {2 a b \left (\sin ^{3}\left (d x +c \right )\right )}{3 d}+\frac {\sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right ) a^{2}}{3 d}+\frac {2 a^{2} \sin \left (d x +c \right )}{3 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x)

[Out]

-1/3/d*b^2*sin(d*x+c)^3-1/d*b^2*sin(d*x+c)+1/d*b^2*ln(sec(d*x+c)+tan(d*x+c))+2/3*a*b*sin(d*x+c)^3/d+1/3/d*sin(
d*x+c)*cos(d*x+c)^2*a^2+2/3*a^2*sin(d*x+c)/d

________________________________________________________________________________________

maxima [A]  time = 0.65, size = 72, normalized size = 1.29 \[ -\frac {2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \sin \left (d x + c\right )^{3} - 3 \, b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, b^{2} \log \left (\sin \left (d x + c\right ) - 1\right ) - 6 \, {\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

-1/6*(2*(a^2 - 2*a*b + b^2)*sin(d*x + c)^3 - 3*b^2*log(sin(d*x + c) + 1) + 3*b^2*log(sin(d*x + c) - 1) - 6*(a^
2 - b^2)*sin(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 14.04, size = 136, normalized size = 2.43 \[ \frac {2\,b^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {\left (2\,a^2-2\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {4\,a^2}{3}+\frac {16\,a\,b}{3}-\frac {20\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^2-2\,b^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^3*(a + b*tan(c + d*x)^2)^2,x)

[Out]

(2*b^2*atanh(tan(c/2 + (d*x)/2)))/d + (tan(c/2 + (d*x)/2)^5*(2*a^2 - 2*b^2) + tan(c/2 + (d*x)/2)^3*((16*a*b)/3
 + (4*a^2)/3 - (20*b^2)/3) + tan(c/2 + (d*x)/2)*(2*a^2 - 2*b^2))/(d*(3*tan(c/2 + (d*x)/2)^2 + 3*tan(c/2 + (d*x
)/2)^4 + tan(c/2 + (d*x)/2)^6 + 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos ^{3}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**3*(a+b*tan(d*x+c)**2)**2,x)

[Out]

Integral((a + b*tan(c + d*x)**2)**2*cos(c + d*x)**3, x)

________________________________________________________________________________________